$(function(){
	window.LT={	
		init:function(){
			var instance = this;		
			
			instance.mainPageBuild();			
			
			$( window ).on( "orientationchange", function( event ) {
			  (event.orientation=='landscape')?$('#main').addClass('landscape'):$('#main').removeClass('landscape');
			  instance.mainPageBuild();
			});		
			
			$( window ).orientationchange();
		},	
			
		mainPageBuild:function(){
			var heightPage = $('#main div[data-role="content"]').height()+$('#main div[data-role="header"]').height();
			$('#main div[data-role="footer"]').height(window.innerHeight - heightPage);
			var addChioseButton = $('#main #add-choise'), trainingChoiseButton=$('#main #training-choise'),
			description=$('#main #description'), buttonEnter = $('#main #buttonEnter');
			
			addChioseButton.click(function(){
				description.text('Choise this if you want to add or edit some new or not new word and frases.');
				$(this).addClass('checked');
				trainingChoiseButton.removeClass('checked');
				buttonEnter.attr('href', '#addEdit').show();
			});
			trainingChoiseButton.click(function(){
				description.text('Choise this if you want to start training.');
				$(this).addClass('checked');
				addChioseButton.removeClass('checked');
				buttonEnter.attr('href', '#training').show();
			});
		}			
	}; window.LT.init();
});